Use panic only for unrecoverable programmer errors and invariant violations. Use recover at process boundaries like HTTP handlers to prevent one request from crashing the server. Never use panic for expected business errors.
Panic: nil pointer dereference, index out of bounds, type assertion on wrong type (programmer errors)
Panic in init() functions is acceptable — startup misconfiguration should be fatal
Recover should only be used at package/process boundaries — never silently swallow panics
After recover, log a full stack trace and decide: return error to caller, or restart the operation
Libraries should never panic for expected conditions — only the application layer should use panic/recover